package cn.wanda.bi.sunshine.platform.server.client.wrapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import cn.wanda.bi.sunshine.platform.server.client.FFanRtxClient;
import cn.wanda.bi.sunshine.platform.server.controller.response.common.SimpleResponse;
import cn.wanda.bi.sunshine.platform.server.utils.JsonUtil;
import cn.wanda.bi.sunshine.platform.server.utils.exception.ClientException;


/**
 * Created by wangfupeng1
 */
@Component
public class FFanRtxClientWrapper {

    @Autowired
    private FFanRtxClient fFanRtxClient;
    
//    @Autowired
//    private SysUserService sysUserService;

    /**
     * 万信登录校验
     */
    public SimpleResponse rtxVerify(String name, String password) {
        SimpleResponse response =
                JsonUtil.toObject(fFanRtxClient.rtxVerify(name, password), SimpleResponse.class);
        if (response.getStatus() != 200)
            throw new ClientException(response.getStatus(), response.getMessage());
        return SimpleResponse.success();
    }

}
